<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->

<head>
<meta charset="utf-8">
<title>SMM撮合系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta content="" name="description">
<meta content="" name="author">
<script>BASE_URL ='${request.getContextPath()}'</script>
<link href="${request.getContextPath()}/Public/assets/admin/css/css.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css">

<link href="${request.getContextPath()}/Public/assets/global/css/components-rounded.css" id="style_components" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/css/plugins.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/admin/css/layout.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/admin/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color">
<link href="${request.getContextPath()}/Public/assets/admin/css/custom.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css">

<link href="${request.getContextPath()}/Public/assets/admin/css/common.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/css/kkpager.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="${request.getContextPath()}/Public/favicon.ico">
<link href="${request.getContextPath()}/Public/css/client.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/css/customerDetail.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="${request.getContextPath()}/Public/My97DatePicker/WdatePicker.js"></script>
<style type="text/css">
body {
	margin: 0;
	padding: 0;
}
/*div_Import */
#div_Import {
	position: fixed;
	z-index: 999;
	width: 600px;
	height: 400px;
	border: 1px solid #ccc;
	background: #efefef;
	display: none;
	overflow: auto;
}

#div_Import .tit {
	background: #ddd;
	display: block;
	height: 15px;
}

#div_Import .tit i {
	float: right;
	line-height: 15px;
	padding: 0 8px;
	cursor: pointer;
}
</style>
</head>

<body class="page-header-top-fixed">
	<!--头部信息结束 -->
	<div class="page-header">
		<!--头部开始-->
		<#include "/include/top.html" />
		<!-- 头部信息结束 -->
		<!-- 头部菜单开始 -->
		<#include "/include/top_menu.html" />
		<!-- 头部菜单结束 -->
	</div>
	<!-- END HEADER -->

		<!-- BEGIN PAGE CONTAINER -->
<div class="page-container">
	<!-- 内容开始 -->
	<div class="page-content">
		<div class="container-fluid">
			<!-- 当前位置提示结束 -->
			<div class="row margin-top-10">
				<!--位置提示结束  -->
				<div class="col-md-12">
				     <div class="portlet light bordered">
					    <div class="portlet-body">
			    			<div class="row" style="height: 30px; text-align: left; padding-left: 3px;">
								<div class="col-sm-12">
									<div id="sample_2_filter" class="dataTables_filter">
										<button class="btn green" type="button" style="float: right;" id="reback">
											<i class="fa"></i> 返回撮合交易管理页面
										</button>
									</div>
								</div>
							</div>
						<div class="table-scrollable">
				          		<table class="table table-striped table-bordered table-advance table-hover ttTbl" id="myTable" >
						          	<thead>
										<tr>
											<th>客户</th>
											<th>联系人</th>
											<th>电话</th>
											<th>价格</th>
											<th>更新时间</th>
											<th>操作</th>
										</tr>
								</thead>
								<tbody>
										<#list list as pool>
									       <tr class="odd gradeX">
									       		<input type="hidden" id="id" name="id" value="${pool.id}">
									       		<input type="hidden" id="poolId" name="poolId" value="${pool.poolId}">
						  						<input type="hidden" id="poolType" name="poolType" value="${pool.poolType}">
												<td>${(pool.customerName)!}</td>
												<td>${(pool.lxrName)!}</td>
												<td>${(pool.mobilePhone)!}</td>
												<td>${(pool.typeAmt)!}</td>
												<td>${(pool.updatedAt?string('yyyy-MM-dd HH:mm:ss'))!}</td>
												<td style="text-align: center;">
													<a class="btn btn-xs green"  href="#"  onclick="updateById(${pool.id},${pool.poolId},${pool.poolType});">修改</a> 
													<button type="button"  onclick="deleteById('${pool.id}','${pool.poolId}','${pool.poolType}')" class="btn btn-xs green">关闭</button>
													
													<!-- 还盘价格没有匹配报盘价格，“生成订单”不展示 -->
													<#if poolType == 1 && pool.price gte baopanjia >
													<a class="btn btn-xs green"  href="${request.getContextPath()}/buyOrder/toAddOrder.do?id=${pool.id}&poolId=${pool.poolId}&poolType=${pool.poolType}">生成订单</a>
													</#if>
													<#if poolType == 2 && pool.price lte baopanjia >
													<a class="btn btn-xs green"  href="${request.getContextPath()}/buyOrder/toAddOrder.do?id=${pool.id}&poolId=${pool.poolId}&poolType=${pool.poolType}">生成订单</a>
													</#if>
												 </td>
											</tr>
									</#list>
								  </tbody>
								</table>
						 	</div>		
						    </div>
					    </div>
					</div>
				</div>
		</div>
</div>
</div>


<!-- END PAGE CONTAINER -->


<!-- 底部开始 -->
<#include "/include/foot.html" />
<!-- 底部结束 -->

<!--[if lt IE 9]>
<script src="${request.getContextPath()}/Public/assets/global/plugins/respond.min.js"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/excanvas.min.js"></script> 
<![endif]-->
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.js"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/scripts/metronic.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/admin/scripts/layout.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/kkpager.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/admin/scripts/commonUtils.js" type="text/javascript"></script>


<script>
jQuery(document).ready(function() {
	Metronic.init(); // init metronic core componets
	Layout.init(); // init layout
});



	function updateById(id,poolId,poolType){
		CommonUtils.editModal("updateById.do?id="+id+"&poolId="+poolId+"&poolType="+poolType, 600);
	}

	function deleteById(id,poolId,poolType){
		if(confirm('是否确认关闭？')){
			$.ajax({
				url : "${request.getContextPath()}/poolprice/deleteById.do",
				type : "post",
				dataType:"json",
				async: false,
				data: "id=" + id + "&poolId=" + poolId + "&poolType=" + poolType,
				success : function(result) {
					 if(result.code=="success"){
				      		window.location.href="${request.getContextPath()}/poolprice/getPoolPrice.do?poolType="+poolType+"&poolId="+poolId;
					}
				  }
			});
		}else{
			return;
		}
	};
	
	//返回撮合交易管理页面
	$("#reback").click(function(){
		window.location.href="${request.getContextPath()}/business/index.do";
	});

</script>


</body>
</html>